Skip to content

Make ase,mdtraj and MDAnalysis optional extras#1254

Open
oerc0122 wants to merge 3 commits into
ISISNeutronMuon:protosfrom
oerc0122:optional-extras
Open

Make ase,mdtraj and MDAnalysis optional extras#1254
oerc0122 wants to merge 3 commits into
ISISNeutronMuon:protosfrom
oerc0122:optional-extras

Conversation

@oerc0122

@oerc0122 oerc0122 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description of work
Remove explicit dependency on optional external projects.

Fixes

  • Remove dependency on ase, mdtraj and mdanalysis
  • Disable jobs if not present.
  • Add visible label to Configurable s to enable visibility without working.
  • These should also have a requires_extras tuple to display a useful error message to users for disabled jobs.

To test
Try GUI, ensure jobs are disabled. Ensure tests pass.

@oerc0122 oerc0122 self-assigned this Jul 1, 2026
@oerc0122 oerc0122 added the enhancement New feature or request label Jul 1, 2026
@MBartkowiakSTFC

Copy link
Copy Markdown
Collaborator

Could we change the behaviour so the corresponding jobs are still listed in the GUI, but are not enabled if their underlying Python package is not installed? This would prevent the situation where a new user never realises that they had the option of installing external packages. What do you think?

@oerc0122

oerc0122 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

This is exactly what Chi said, so it seems like a popular option. Do we want to change enabled to grey out the option rather than not list in general?

@MBartkowiakSTFC

Copy link
Copy Markdown
Collaborator

At the moment the enabled variable in MDANSE also controls if the job is visible. We probably need a distinction between enabled and visible.

On the GUI side, it should be possible to run .setEnabled(False) on the specific QStandardItem in the JobTree.

return

if not job_instance.enabled:
widget = QLabel(f"""<h1>Job {job_name} not available.</h1>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oerc0122 @ChiCheng45 What phrasing do we prefer for this message?

I would consider emphasising in the text that the whole thing is optional, so the users don't wonder why we did not include the required dependency to start with. Something like:

                widget = QLabel(f"""<h1>{job_name} requires an external package.</h1>

                <h2>The following optional dependencies of MDANSE are needed here: {", ".join(job_instance.requires_extras)}.</h2>

                <h2>If you want to use {job_name}, please install the additional dependencies, e.g. by running:</h2>

                <h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2>
                """)

Anyway, I'm also happy with the current version (especially since it tells the user what to do to enable the job).

Comment on lines +244 to +250
widget = QLabel(f"""<h1>Job {job_name} not available.</h1>

<h2>Please install MDANSE with the following extras enabled: {", ".join(job_instance.requires_extras)}.</h2>

<h2>To do this, install using, e.g.:</h2>

<h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably combine the two to make:

Suggested change
widget = QLabel(f"""<h1>Job {job_name} not available.</h1>
<h2>Please install MDANSE with the following extras enabled: {", ".join(job_instance.requires_extras)}.</h2>
<h2>To do this, install using, e.g.:</h2>
<h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2>
widget = QLabel(f"""<h1>{job_name} requires an external package.</h1>
<h2>Please install MDANSE with the following
optional dependencies enabled:
{", ".join(job_instance.requires_extras)}.</h2>
<h2>To do this, install using, e.g.:</h2>
<h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants